package com.mango.handler;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @Author:  MangoCookieMilk
 * @Date:     2021/1/13 22:16
 * 自定义异常处理
 */
@Data
public class BusinessException extends RuntimeException{

    @ApiModelProperty(value = "状态码")
    private Integer code;
    @ApiModelProperty(value = "错误信息")
    private String errMsg;
    public BusinessException(Integer code, String errMsg){
        this.code = code;
        this.errMsg = errMsg;
    }
    public  BusinessException(){

    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }
}
